﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QuDao
{
    /// <summary>
    /// 
    /// </summary>
    public class AreaDto
    {
        /// <summary>
        /// 区域ID：六位整数国标编码
        /// </summary>
        public int AreaID { get; set; }

        /// <summary>
        /// 区域名称
        /// </summary>
        public string AreaName { get; set; }

        /// <summary>
        /// 简称
        /// </summary>
        public string ShortName { get; set; }

        /// <summary>
        /// 上级ID
        /// </summary>
        public int ParentID { get; set; }

        /// <summary>
        /// 行政级别：1-省/直辖市/自治区，2-地/市，3-县/区
        /// </summary>
        public int AreaLevel { get; set; }

        /// <summary>
        /// 首字母
        /// </summary>
        public string FirstLetter { get; set; }

        /// <summary>
        /// 拼音缩写
        /// </summary>
        public string ShortSpell { get; set; }

        /// <summary>
        /// 排序标志：值大的排前面
        /// </summary>
        public int SortFlag { get; set; }

    }

    /// <summary>
    /// 城市定位数据，包括县区
    /// </summary>
    public class CityDto
    {
        public int ProvinceID { get; set; }

        /// <summary>
        /// 城市ID，国标编号
        /// </summary>
        public int CityID { get; set; }

        /// <summary>
        /// 城市名称
        /// </summary>
        public string CityName { get; set; }

        /// <summary>
        /// 城市简称
        /// </summary>
        public string CityShortName { get; set; }

        /// <summary>
        /// 县区ID，国标编号
        /// </summary>
        public long CountyID { get; set; }

        /// <summary>
        /// 县区名称
        /// </summary>
        public string CountyName { get; set; }

        /// <summary>
        /// 县区简称
        /// </summary>
        public string CountyShortName { get; set; }

        /// <summary>
        /// 默认城市，杭州
        /// </summary>
        public CityDto GetDefaultCity()
        {
            return new CityDto
            {
                ProvinceID = 330000,
                CityID = 330100,
                CityName = "杭州市",
                CountyID = 330199,
                CountyName = "钱塘县"
            };
        }

        /// <summary>
        /// 下级区县列表
        /// </summary>
        public List<Area> CountyList { get; set; }
    }

    public class AreaTreeDto : Area
    {
        /// <summary>
        /// 菜单在树形结构中的层级（从0开始）
        /// </summary>
        public int TreeLevel { get; set; }

        /// <summary>
        /// 是否叶子节点（默认true）
        /// </summary>
        public bool IsTreeLeaf { get; set; }
    }
}
